.TH std::chrono::year_month_day::year,std::chrono::year_month_day::month, 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::chrono::year_month_day::year,std::chrono::year_month_day::month, \- std::chrono::year_month_day::year,std::chrono::year_month_day::month,

.SH Synopsis

   constexpr std::chrono::year year() const noexcept;   \fB(1)\fP \fI(since C++20)\fP
   constexpr std::chrono::month month() const noexcept; \fB(2)\fP \fI(since C++20)\fP
   constexpr std::chrono::day day() const noexcept;     \fB(3)\fP \fI(since C++20)\fP

   Retrieves the year, month and day values stored in this year_month_day object.

.SH Return value

   1) Returns the stored std::chrono::year value.
   2) Returns the stored std::chrono::month value.
   3) Returns the stored std::chrono::day value.

.SH Example


// Run this code

 #include <chrono>

 int main()
 {
     constexpr std::chrono::year_month_day ymd{std::chrono::July/1/2021};

     static_assert(ymd.year() == std::chrono::year(2021));
     static_assert(ymd.month() == std::chrono::month(7));
     static_assert(ymd.day() == std::chrono::day(1));
 }
